From 1f4adcb13a5a6a1b308850d01f0a29ce0b211725 Mon Sep 17 00:00:00 2001 From: Steven Hand Date: Mon, 28 Aug 2006 21:25:13 +0100 Subject: [PATCH] Fix PAE-mode HVM guests with the new shadow code. Signed-off-by: Steven Hand --- xen/arch/x86/mm/shadow/multi.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index aed36c5f34..2e87af32aa 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -2543,6 +2543,16 @@ static int validate_gl3e(struct vcpu *v, void *new_ge, mfn_t sl3mfn, void *se) perfc_incrc(shadow_validate_gl3e_calls); +#if (SHADOW_PAGING_LEVELS == 3) && (GUEST_PAGING_LEVELS == 3) + { + /* If we've updated a subshadow which is unreferenced then + we don't care what value is being written - bail. */ + struct pae_l3_bookkeeping *info = sl3p_to_info(se); + if(!info->refcount) + return result; + } +#endif + if ( guest_l3e_get_flags(*new_gl3e) & _PAGE_PRESENT ) { gfn_t gl2gfn = guest_l3e_get_gfn(*new_gl3e); @@ -2634,7 +2644,7 @@ static int validate_gl1e(struct vcpu *v, void *new_ge, mfn_t sl1mfn, void *se) /**************************************************************************/ -/* Functions which translate and install a the shadows of arbitrary guest +/* Functions which translate and install the shadows of arbitrary guest * entries that we have just seen the guest write. */ @@ -2934,7 +2944,7 @@ static int sh_page_fault(struct vcpu *v, && shadow_vcpu_mode_translate(v) && mmio_space(gfn_to_paddr(gfn)) ); - /* For MMIO, the shadow holds the *gfn*; for normal accesses, if holds + /* For MMIO, the shadow holds the *gfn*; for normal accesses, it holds * the equivalent mfn. */ if ( mmio ) gmfn = _mfn(gfn_x(gfn)); -- 2.30.2